home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / !Interfaces / Universal Interfaces 2.0a1 / CIncludes / CommResources.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-17  |  3.8 KB  |  117 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        CommResources.h
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a1.  ETO #15, MPW prerelease.  Sunday, July 17, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. */
  16.  
  17. #ifndef __COMMRESOURCES__
  18. #define __COMMRESOURCES__
  19.  
  20.  
  21. #ifndef __OSUTILS__
  22. #include <OSUtils.h>
  23. #endif
  24. /*    #include <Types.h>                                            */
  25. /*        #include <ConditionalMacros.h>                            */
  26. /*    #include <MixedMode.h>                                        */
  27.  
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31.  
  32. #if GENERATINGPOWERPC
  33. #pragma options align=mac68k
  34. #endif
  35.  
  36. #ifdef __CFM68K__
  37. #pragma lib_export on
  38. #endif
  39.  
  40.  
  41. enum {
  42. /*    tool classes (also the tool file types)    */
  43.     classCM                        = 'cbnd',
  44.     classFT                        = 'fbnd',
  45.     classTM                        = 'tbnd'
  46. };
  47.  
  48. enum {
  49. /*    version of the Comm Resource Manager    */
  50.     curCRMVersion                = 2,
  51. /* constants general to the use of the Communications Resource Manager */
  52.     crmType                        = 9,                            /* queue type    */
  53.     crmRecVersion                = 1,                            /* version of queue structure */
  54. /*    error codes */
  55.     crmGenericError                = -1,
  56.     crmNoErr                    = 0
  57. };
  58.  
  59. /* data structures general to the use of the Communications Resource Manager */
  60. typedef OSErr CRMErr;
  61.  
  62. struct CRMRec {
  63.     QElemPtr                        qLink;                        /*reserved*/
  64.     short                            qType;                        /*queue type -- ORD(crmType) = 9*/
  65.     short                            crmVersion;                    /*version of queue element data structure*/
  66.     long                            crmPrivate;                    /*reserved*/
  67.     short                            crmReserved;                /*reserved*/
  68.     long                            crmDeviceType;                /*type of device, assigned by DTS*/
  69.     long                            crmDeviceID;                /*device ID; assigned when CRMInstall is called*/
  70.     long                            crmAttributes;                /*pointer to attribute block*/
  71.     long                            crmStatus;                    /*status variable - device specific*/
  72.     long                            crmRefCon;                    /*for device private use*/
  73. };
  74. typedef struct CRMRec CRMRec;
  75.  
  76. typedef CRMRec *CRMRecPtr;
  77.  
  78. extern pascal CRMErr InitCRM(void);
  79. extern pascal QHdrPtr CRMGetHeader(void);
  80. extern pascal void CRMInstall(CRMRecPtr crmReqPtr);
  81. extern pascal OSErr CRMRemove(CRMRecPtr crmReqPtr);
  82. extern pascal CRMRecPtr CRMSearch(CRMRecPtr crmReqPtr);
  83. extern pascal short CRMGetCRMVersion(void);
  84. extern pascal Handle CRMGetResource(ResType theType, short theID);
  85. extern pascal Handle CRMGet1Resource(ResType theType, short theID);
  86. extern pascal Handle CRMGetIndResource(ResType theType, short index);
  87. extern pascal Handle CRMGet1IndResource(ResType theType, short index);
  88. extern pascal Handle CRMGetNamedResource(ResType theType, ConstStr255Param name);
  89. extern pascal Handle CRMGet1NamedResource(ResType theType, ConstStr255Param name);
  90. extern pascal void CRMReleaseResource(Handle theHandle);
  91. extern pascal Handle CRMGetToolResource(short procID, ResType theType, short theID);
  92. extern pascal Handle CRMGetToolNamedResource(short procID, ResType theType, ConstStr255Param name);
  93. extern pascal void CRMReleaseToolResource(short procID, Handle theHandle);
  94. extern pascal long CRMGetIndex(Handle theHandle);
  95. extern pascal short CRMLocalToRealID(ResType bundleType, short toolID, ResType theType, short localID);
  96. extern pascal short CRMRealToLocalID(ResType bundleType, short toolID, ResType theType, short realID);
  97. extern pascal OSErr CRMGetIndToolName(OSType bundleType, short index, Str255 toolName);
  98. extern pascal OSErr CRMFindCommunications(short *vRefNum, long *dirID);
  99. extern pascal Boolean CRMIsDriverOpen(ConstStr255Param driverName);
  100. extern pascal CRMErr CRMParseCAPSResource(Handle theHandle, ResType selector, unsigned long *value);
  101. extern pascal OSErr CRMReserveRF(short refNum);
  102. extern pascal OSErr CRMReleaseRF(short refNum);
  103.  
  104. #ifdef __CFM68K__
  105. #pragma lib_export off
  106. #endif
  107.  
  108. #if GENERATINGPOWERPC
  109. #pragma options align=reset
  110. #endif
  111.  
  112. #ifdef __cplusplus
  113. }
  114. #endif
  115.  
  116. #endif /* __COMMRESOURCES__ */
  117.